package cn.chencaiju.blog.domain;

import java.util.List;

public class Category {
	private int id;
	private String name;
	private int num;
	private int priority;
	private List<Post> posts;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	public void setNum(String num) {
		if(num!=null&&num!="") {
			this.num=Integer.valueOf(num);
		}
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Category [id=");
		builder.append(id);
		builder.append(", name=");
		builder.append(name);
		builder.append(", num=");
		builder.append(num);
		builder.append(",priority=");
		builder.append(priority);
		builder.append("]");
		return builder.toString();
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public void setPriority(String priority) {
		if(priority!=null&&priority!="") {
			this.priority=Integer.valueOf(priority);
		}
	}
	public List<Post> getPosts() {
		return posts;
	}
	public void setPosts(List<Post> posts) {
		this.posts = posts;
	}
	
}